Content starts here Test a Read Function and Simple Update
This page last changed on Mar 11, 2008.

eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents

How To Test a Read Function and Simple Update

This topic describes how to test any Read function in an entity data service (either logical or physical) in Test view.

Adjust Settings

A read function fetches data. 

A physical or logical data service usually has at least one read function. You can test a read function with either sample data or real-time data, from the Test tab in Studio. Testing a read function ensures that:

  • You can read data from the physical data sources.
  • The returned data has the structure you want, especially for a logical data service.
  • The query performs well.

The returned data is displayed in the Test tab.

Checking the Data Returned by a Read Function

When you test a read function, Studio deploys the service to the server if it is not yet deployed, or if it has changed since it was last deployed.

A read function allows you to specify various settings.

Settings You Can Change for the Read Function

You might want to test with a smaller result set. Select

Limit Elements in Array Results To

to limit the result to a specific number of elements of the return type, to specific child elements in the return type, or both.

Use Start Client Transaction to query multiple relational sources using XA transaction drivers (if selected, ALDSP uses the Required transaction mode to query data sources; if not, ALDSP uses the NonSupported EJB transaction method).

Run the Read Function

A read function optionally can have parameters. It is quite common for a read function to have no parameters, with a name something like read() or ADDRESS().

If you are working with a logical service, the update map must be completely enabled before you can run a read function in Test view. If the update map has yellow update blocks or disabled procedures , you must resolve them  before you can test a Read function.

To test a Read function:

  1. Open an entity data service in Studio.
  2. Click the Test tab.
  3. At Select Operation, choose the name of the read function you want to test.
  4. Expand the Settings tab.
  5. Choose values for Limit Elements in Array Results To, Start Client Transaction, and Use Default Authentication.
  6. Click Run.
    If the results are correct, you see this: . You can now click Tree, Text, or Tabular to inspect the returned data.

Perform a Simple Update

The easiest way to test that you can update a data source is to use the Edit and Submit buttons in Test view.

Before you test an update, be sure that:

  • The service has a primary update procedure. You can check this by right-clicking an update procedure in the Overview tab and making sure Primary is selected. You can also check for

    isPrimary="true"

    in the procedure's pragma statement in the Source tab, for example:

    (::pragma  function <f:function kind="update" visibility="public" isPrimary="true" xmlns:f="urn:annotations.ld.bea.com"> ... ::)
  • The update map is fully enabled for a logical entity service that has an update map. If the update map is not, see Recognize When Something is Wrong. If you are updating a logical data service, you are actually testing an update map. The update will work on any underlying data sources that you have permission to update.

To update data after running a Read function:

  1. Click Edit, and edit the field you choose.
  2. Click Submit.
    If the data is submitted correctly, you see this message:
    The data has been submitted.

See Also

Concepts
How Tos



Document generated by Confluence on Apr 28, 2008 15:57